<?php if ($action == ''): ?>
	    <table width="100%" border="0" cellpadding="5">
	      <tr>
	        <td height="243" valign="top" bgcolor="#FFFFFF">
            <table width="100%" border="0" cellspacing="3">
	          <tr>
	            <td height="338" align="center" valign="top" bgcolor="#f7f7f7"><table width="98%" border="0" cellspacing="3" cellpadding="0">
	              <tr>
	                <td width="100%" height="22" align="left" valign="middle" bgcolor="#f7f7f7">
	               		<table width="100%">
	               			<tr ><td> <strong>Current {page}</strong></td>
	               			<td align="right"><strong><a href="{url}/{page}/create"></>Create New {caption}</a></strong></td></tr>
	              	    </table>
	                </td>
                  </tr>
	              <tr>
	                <td height="305" align="left" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="3">
	                  <tr>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Created On</td>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Created By</td>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Updated On</td>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Updated By</td>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Code</td>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Name</td>
	                    <td height="28" align="center" valign="middle" bgcolor="#efeeee">Action</td>
                      </tr>
                    </table>
	                  <table width="100%" border="0" cellspacing="o" cellpadding="o" style="border-bottom:1px solid#CCC;">
	                   <?php if (isset($userList)): ?>
	                   <!-- ALTERNATIVE FOR FOREACH -->
	                   {userList}
	                    <tr>
	                      <td width="15%" height="33" align="center">{createdon}</td>
	                      <td width="15%" align="center">{updatedon}</td>
	                      <td width="18%" align="center">{firstname} {maidenname} {surname}</td>
	                      <td width="16%" align="center">{email}</td>
	                      <td width="16%" align="center">{usertype}</td>
	                      <td width="16%" align="center"><a href="{url}/{page}/edit/{id}">Edit</a> | <a href="{url}/{page}/delete/{id}">Delete</a></td>
                        </tr>
                        {/userList}
						<?php endif; ?> 
                    	</table>
                    </td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
	      </table>
	      
	
<?php elseif($action == 'add' || $action == 'edit' ): ?>   

 	

	    <table width="100%" border="0" cellpadding="5">
          <tr>
                <td width="100%" height="22" align="left" valign="middle" bgcolor="#f7f7f7">
	               <table width="100%">
	               <tr ><td> <strong>Add new {caption}</strong></td>
	               <td align="right"></td></tr>
                  </table>
               </td>
          </tr>
          
         
	      <tr>
	        <td height="722" valign="top" bgcolor="#FFFFFF">
	        <form action="{url}/{page}/save" method="post">
	        <?php if(isset($id)):?>
	        	<input type="hidden" name="id" value="<?=(isset($id)?$id:'');?>">
	        <?php endif;?>
		    
	        
            <table width="100%" border="0" cellspacing="3">
	          <tr>
	            <td height="652" align="center" valign="top" bgcolor="#f7f7f7"><table width="98%" border="0" cellspacing="3" cellpadding="0">
	              <tr>
	                <td colspan="5" align="left" valign="middle"><strong>Team Information</strong></td>
	               </tr>

	              
	              <tr>
	                <td colspan="5" align="left" valign="middle"><strong>Employee Information</strong></td>
	               </tr>
	              <tr>
	                <td width="19%" align="left" valign="middle">Surname</td>
	                <td width="30%" valign="middle"><input name="surname" value="<?=(isset($surname)?$surname:'');?>" type="text" id="textfield" size="30" /></td>
	                <td width="4%" valign="middle">&nbsp;</td>
	                <td width="18%" align="left" valign="middle">User Type</td>
	                <td width="29%" height="22" align="left" valign="middle">
	                
	                <select name="usertype" style="width: 215px">
	                	<option value="">--select--</option>
	                	<option value="A" <?=(($usertype == 'A')?"selected":"");?>>Administrator</option>
	                	<option value="S" <?=(($usertype == 'S')?"selected":"");?>>Sacho</option>
	                	<option value="V" <?=(($usertype == 'V')?"selected":"");?>>Supervisor</option>
	                	<option value="T" <?=(($usertype == 'T')?"selected":"");?>>Team Lead</option>
	                	<option value="S" <?=(($usertype == 'S')?"selected":"");?>>Staff</option>
	                	<option value="E" <?=(($usertype == 'E')?"selected":"");?>>Encoder</option>
	                </select>
	                </td>
                  
                  </tr>
                    <tr>
	                <td width="19%" align="left" valign="middle">Maiden Name</td>
	                <td width="30%" valign="middle"><input name="maidenname" value="<?=(isset($maidenname)?$maidenname:'');?>" type="text" id="textfield" size="30" /></td>
	                <td width="4%" valign="middle">&nbsp;</td>
	                <td width="18%" align="left" valign="middle">Status</td>
	                <td width="29%" height="22" align="left" valign="middle">
	                 <select name="status" size="1" id="status" style="width: 215px">
                    	<option value="">-select-</option>
                        <option value="regular"<?=(($status == 'regular')?"selected":"");?>>Regular</option>
                        <option value="resigned"<?=(($status == 'resigned')?"selected":"");?>>Resigned</option>
                    </select>
	                </td>
                  </tr>
                    <tr>
	                <td width="19%" align="left" valign="middle">Firstname</td>
	                <td width="30%" valign="middle"><input name="firstname" value="<?=(isset($firstname)?$firstname:'');?>" type="text" id="textfield" size="30" /></td>
	                <td width="4%" valign="middle">&nbsp;</td>
	                <td width="18%" align="left" valign="middle">Staff Code</td>
	                <td width="29%" height="22" align="left" valign="middle">
	                 <input name="staffcode" value="<?=(isset($staffcode)?$staffcode:'');?>" type="text" id="textfield" size="30" />
	                </td>
                  </tr>
                  <tr>
	                <td colspan="5" align="left" valign="middle"><strong>Account Information</strong></td>
	               </tr>
	               <tr>
	                <td width="19%" align="left" valign="middle">Username</td>
	                <td width="30%" valign="middle"><input name="username" value="<?=(isset($username)?$username:'');?>" type="text" id="textfield" size="30" /></td>
	                <td width="4%" valign="middle">&nbsp;</td>
	                <td width="18%" align="left" valign="middle">Password</td>
	                <td width="29%" height="22" align="left" valign="middle"><input name="password" value="<?=(isset($password)?$password:'');?>" type="text" id="textfield2" size="30" /></td>
                  
                  </tr>
                  <tr>
	                <td width="19%" align="left" valign="middle">Email</td>
	                <td width="30%" valign="middle"><input name="email" value="<?=(isset($email)?$email:'');?>" type="text" id="textfield" size="30" /></td>
	                <td width="4%" valign="middle">&nbsp;</td>
	                <td width="18%" align="left" valign="middle"></td>
	                <td width="29%" height="22" align="left" valign="middle"></td>
                  
                  </tr>
				  
            </table>
              
                  <table width="98%" border="0" cellspacing="3" cellpadding="o">
                  <tr>
		            <td colspan="" align="left" valign="middle">&nbsp;</td>
		                  <td valign="middle">&nbsp;</td>
		                  <td height="22" colspan="2" align="right" valign="middle"><input name="button2" type="submit" class="btnSubmit" id="button2" value="Save" /></td>
		          </tr>
                </table>
           	 </form>
            </td>
          </tr>
          
	    </table>
	  
<?php endif; ?> 